home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / RGASM.RAR / ASMCODE.EXE / CHAPT1-5 / ASM.BAT next >
Encoding:
DOS Batch File  |  1994-08-27  |  2.5 KB  |  102 lines

  1. @Echo Off
  2. Set _SavPath_=%path%
  3. Path %AsmPath%;%_SavPath_%
  4. Set Comp=ASM
  5. Set DebMode=N
  6. If %1. == . GoTo Noparm
  7. If %1. == ?. GoTo Help
  8. If %1. == /H. GoTo Help
  9. If %1. == /h. GoTo Help
  10. If %1. == /d. GoTo Debug1
  11. If %1. == /D. GoTo Debug1
  12. If %2. == /d. GoTo DebOth
  13. If %2. == /D. GoTo DebOth
  14. If %3. == /d. GoTo DebOth
  15. If %3. == /D. GoTo DebOth
  16. If %4. == /d. GoTo DebOth
  17. If %4. == /D. GoTo DebOth
  18. GoTo Working
  19. :Debug1
  20. Shift
  21. :DebOth
  22. Echo.
  23. Echo Flag /d was specified - module %1.asm is being prepared for debugging
  24. Set debmode=Y
  25. GoTo Working
  26. :NoParm
  27. Echo.
  28. Echo No parameters specified - "HELP" action assumed
  29. Echo To standard HELP function type "%0 /h" or "%0 ?"
  30. :Help
  31. Echo.
  32. Echo %0 - command to ASSEMBLY programm(s) compilation
  33. Echo.
  34. Echo Usage:  %0 source [object] [listing] [/d]
  35. Echo.
  36. Echo Parameters:
  37. Echo.
  38. Echo source  - source module name (without "ASM" extension)
  39. Echo           Default : NONE (parameter needed)
  40. Echo object  - object module name (without "OBJ" extension)
  41. Echo           Default : obj.obj (if the %%TMP%% environment variable was
  42. Echo                       defined - %tmp%\obj.obj)
  43. Echo listing - compiler listing file name (without "LST" extension)
  44. Echo           Default : lst.lst (if the %%TMP%% environment variable was
  45. Echo                       defined - %tmp%\lst.lst)
  46. Echo /d      - flag to set "debugging" compiler option
  47. Echo.
  48. Echo Example:
  49. Echo.
  50. Echo %0 c:\myprog\kwakwa,,c:\mylist\kwakwa
  51. GoTo Exit
  52. :Working
  53. If %tmp%. == . set tmp=c:\tmp
  54. Del %tmp%\obj.obj > nul
  55. Del %tmp%\lst.lst > nul
  56. Echo.
  57. Echo Compilation ASSEMBLY program %1.asm
  58. Echo.
  59. Echo Use "ESC" key to exit from "BROWSE" command
  60. Echo after end of compilation.
  61. Echo.
  62. Set Options=%AsmOpt%
  63. If %DebMode%. == Y. Set Options=%Options% %AsmOptD%
  64. %AsmPg% %Options% %PrmAsm% %AsmListF6% %1.asm%AsmListF5%%AsmListFT%
  65. Set Options=
  66. :EndComp
  67. Shift
  68. If %1. == /d. GoTo Deb2
  69. If %1. == /D. GoTo Deb2
  70. GoTo NoDeb2
  71. :Deb2
  72. Shift
  73. :NoDeb2
  74. IF ERRORLEVEL 1 GOTO ERR
  75. Echo.
  76. Echo Successful compilation
  77. IF %1. == . GOTO NoObjCp
  78. IF %1. == .. GOTO NoObjCp
  79. Echo.
  80. Echo Object module file will be named %1.obj
  81. COPY %tmp%\obj.obj %1.OBJ > nul
  82. GoTo :NoObjCp
  83. :Err
  84. Echo INVALID PROGRAM - COMPILATION DELETED
  85. :NoObjCp
  86. Shift
  87. If %1. == /d. GoTo Deb3
  88. If %1. == /D. GoTo Deb3
  89. GoTo NoDeb3
  90. :Deb3
  91. Shift
  92. :NoDeb3
  93. IF %1. == . GOTO NoLstCp
  94. Echo Source listing file will be named %1.lst
  95. :NOLST
  96. COPY %tmp%\lst.lst %1.LST > nul
  97. :NoLstCp
  98. :FINIS
  99. BROWSE %tmp%\lst.lst
  100. :Exit
  101. Path %_SavPath_%
  102. Set _SavPath_=